package com.jk.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jk.entity.BankCardEntity;
import com.jk.entity.BusinessEntity;
import com.jk.pojo.UserBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Repository
public interface UserDao extends BaseMapper<UserBean> {

    //走mysql模糊登录
    UserBean findUserByName(@Param("user_name") String user_name,@Param("user_phone") String user_phone);


    UserBean getPhone(String user_phone);

    void updateUserPassward(UserBean userBean);

    /**
     * @Author: binzi
     * @Description:支付宝充值修改用户金额
     * @Date: 2022/11/7 17:44
     * @Return: void
     **/
    void updateMoney(@Param("user_phone") String user_phone, @Param("money") BigDecimal money);

    void updateUser(BusinessEntity businessEntity, Integer user_id);

    /**
     * @Author: binzi
     * @Description:根据手机号查询对应的银行卡号
     * @Date: 2022/11/8 11:24
     * @Return: java.util.Map
     **/
    List<BankCardEntity> findBankCardByPhone(String user_phone);

    /**
    * @Author: binzi
    * @Description:修改银行卡余额
    * @Date: 2022/11/8 15:03
    * @Return: void
    **/
    void updateBankCardMoney(@Param("t_bank_code") String t_bank_code, @Param("t_money") BigDecimal t_money);

    /**
    * @Author: binzi
    * @Description:根据银行卡号回显
    * @Date: 2022/11/8 16:14
    * @Return: com.jk.entity.BankCardEntity
    **/
    BankCardEntity findBankCardByCode(String t_bank_code);
    /*
    *
     * @Author 位佳生
     * @Description //TODO 修改用户余额
     * @Date 2022/11/8 20:19
     * @param user_id: 
 * @param price: 
     * @return: void
     **/
    void updateUserById(Integer user_id, BigDecimal price);

    /**
     * @Author: binzi
     * @Description:根据登录的用户修改支付密码
     * @Date: 2022/11/10 10:31
     * @Return: java.util.Map
     **/
    void updateUserWith(@Param("user_phone") String user_phone, @Param("user_with") String user_with);

    /**
     * @Author: binzi
     * @Description:实名认证
     * @Date: 2022/11/10 11:12
     * @Return: void
     **/
    void updateUserByPhoneAndIdCard(@Param("name") String name, @Param("idcard")String idcard, @Param("user_phone")String user_phone);

    List<UserBean> getUserList(@Param("userBean") UserBean userBean);

    /**
    * @Author: binzi
    * @Description:根据登录手机号查询用户对应的信息
    * @Date: 2022/11/15 19:35
    * @Return: com.jk.pojo.UserBean
    **/
    UserBean findUserByPhone(String user_phone);
    /*
    *
     * @Author 位佳生
     * @Description //TODO 查询当前用户所有信息
     * @Date 2022/11/16 14:32
     * @param user_id: 
     * @return: com.jk.pojo.UserBean
     **/
    UserBean selectByIdUser(Integer user_id);
}
